Telegram Group & Telegram Channel
Даны 2 таблицы с названиями orders и products c колонками "order_id", "customer_id", "product_id", "order_date", "quantity" и "product_id", "product_name", "unit_price". Какой из следующих SQL запросов вернет топ-5 покупателей, которые потратили больше всего в категории "Electronics"?

A) SELECT o.customer_id, SUM(o.quantity * p.unit_price) AS total_spent
FROM orders o JOIN products p ON o.product_id = p.product_id
WHERE p.product_name LIKE '%Electronics%'
GROUP BY o.customer_id
ORDER BY total_spent DESC
LIMIT 5;

B) SELECT o.customer_id, SUM(o.quantity * p.unit_price) AS total_spent
FROM orders o JOIN products p ON o.product_id = p.product_id
WHERE p.product_id IN (SELECT product_id FROM products WHERE product_name LIKE '%Electronics%')
GROUP BY o.customer_id
ORDER BY total_spent DESC
LIMIT 5;

C) SELECT o.customer_id, SUM(o.quantity * p.unit_price) AS total_spent
FROM orders o JOIN products p ON o.product_id = p.product_id
WHERE p.product_id IN (SELECT product_id FROM products WHERE product_name LIKE 'Electronics%')
GROUP BY o.customer_id
ORDER BY total_spent DESC
LIMIT 5;

D) SELECT o.customer_id, SUM(o.quantity * p.unit_price) AS total_spent
FROM orders o JOIN products p ON o.product_id = p.product_id
WHERE p.product_id IN (SELECT product_id FROM products WHERE product_name = 'Electronics')
GROUP BY o.customer_id
ORDER BY total_spent DESC
LIMIT 5;

Ответить на вопрос можно ниже ⬇️



tg-me.com/sql_for_qa/164
Create:
Last Update:

Даны 2 таблицы с названиями orders и products c колонками "order_id", "customer_id", "product_id", "order_date", "quantity" и "product_id", "product_name", "unit_price". Какой из следующих SQL запросов вернет топ-5 покупателей, которые потратили больше всего в категории "Electronics"?

A) SELECT o.customer_id, SUM(o.quantity * p.unit_price) AS total_spent
FROM orders o JOIN products p ON o.product_id = p.product_id
WHERE p.product_name LIKE '%Electronics%'
GROUP BY o.customer_id
ORDER BY total_spent DESC
LIMIT 5;

B) SELECT o.customer_id, SUM(o.quantity * p.unit_price) AS total_spent
FROM orders o JOIN products p ON o.product_id = p.product_id
WHERE p.product_id IN (SELECT product_id FROM products WHERE product_name LIKE '%Electronics%')
GROUP BY o.customer_id
ORDER BY total_spent DESC
LIMIT 5;

C) SELECT o.customer_id, SUM(o.quantity * p.unit_price) AS total_spent
FROM orders o JOIN products p ON o.product_id = p.product_id
WHERE p.product_id IN (SELECT product_id FROM products WHERE product_name LIKE 'Electronics%')
GROUP BY o.customer_id
ORDER BY total_spent DESC
LIMIT 5;

D) SELECT o.customer_id, SUM(o.quantity * p.unit_price) AS total_spent
FROM orders o JOIN products p ON o.product_id = p.product_id
WHERE p.product_id IN (SELECT product_id FROM products WHERE product_name = 'Electronics')
GROUP BY o.customer_id
ORDER BY total_spent DESC
LIMIT 5;

Ответить на вопрос можно ниже ⬇️

BY SQL для тестировщика


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/sql_for_qa/164

View MORE
Open in Telegram


SQL для тестировщика Telegram | DID YOU KNOW?

Date: |

For some time, Mr. Durov and a few dozen staffers had no fixed headquarters, but rather traveled the world, setting up shop in one city after another, he told the Journal in 2016. The company now has its operational base in Dubai, though it says it doesn’t keep servers there.Mr. Durov maintains a yearslong friendship from his VK days with actor and tech investor Jared Leto, with whom he shares an ascetic lifestyle that eschews meat and alcohol.

What is Telegram?

Telegram’s stand out feature is its encryption scheme that keeps messages and media secure in transit. The scheme is known as MTProto and is based on 256-bit AES encryption, RSA encryption, and Diffie-Hellman key exchange. The result of this complicated and technical-sounding jargon? A messaging service that claims to keep your data safe.Why do we say claims? When dealing with security, you always want to leave room for scrutiny, and a few cryptography experts have criticized the system. Overall, any level of encryption is better than none, but a level of discretion should always be observed with any online connected system, even Telegram.

SQL для тестировщика from ua


Telegram SQL для тестировщика
FROM USA